import 'dart:convert';

import 'package:flutter/services.dart';
import 'package:framework/data/model/domain_bean.dart';
import 'package:framework/data/repositories/discover_repository.dart';

/// 具体实现：本地
class DiscoverLocalRepository implements DiscoverRepository {
  @override
  Future<List<DomainBean>> getDomainLists() async {
    final String jsonString =
        await rootBundle.loadString('assets/json/domain.json');
    final List<dynamic> jsonList = jsonDecode(jsonString);
    return jsonList.map((json) => DomainBean.fromJson(json)).toList();
  }
}
